<template>
  <el-dialog width="70vw" :visible.sync="visible" title="小区样板间详情" :close-on-click-modal="false" @open="handleOpen" @closed="handleClosed">
    <c-title title="楼盘签约信息">
      <QupList v-loading="loading" :column="3" sep="：" default-value="" label-position="right" label-width="130">
        <QupListItem label="样板间任务编码" :value="modelRoomInfoDTO.modelRoomTaskCode" />
        <QupListItem label="样板间任务名称" :value="modelRoomInfoDTO.modelRoomTaskName" />
        <QupListItem label="是否签约楼盘" :value="modelRoomInfoDTO.isSigningRealEstate" dict-type-code="BOOLEANS" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
        <QupListItem label="所属签约楼盘" :value="signingRealEstateDTO.realEstateContractNumber" />
        <QupListItem label="小区名称" :value="signingRealEstateDTO.communityName" />
        <QupListItem label="小区详细地址" :value="signingRealEstateDTO.communityAddress" />
        <QupListItem label="交房日期" :value="signingRealEstateDTO.houseDeliveryTime" />
        <QupListItem label="楼盘装修类型" :value="signingRealEstateDTO.roomDecorateType" dict-type-code="DECORATION_TYPE" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
        <QupListItem label="交房户数" :value="signingRealEstateDTO.deliveryModelRoomNumber" />
        <QupListItem label="客户" :value="signingRealEstateDTO.customerCode" />
        <QupListItem label="客户名称" :value="signingRealEstateDTO.customerName" />
        <QupListItem label="所属办事处" :value="signingRealEstateDTO.agencyName" />
        <QupListItem label="办事处性质" :value="signingRealEstateDTO.agencyNature" dict-type-code="OFFICE_NATURE" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
        <QupListItem label="市场级别">
          <c-mdm-view
            :value="signingRealEstateDTO.marketLevel"
            doc-code="QY093"
          />
        </QupListItem>
        <QupListItem label="成品客户经理" :value="signingRealEstateDTO.finishedProductCustomerManagerName" />
        <QupListItem label="定制客户经理" :value="signingRealEstateDTO.customCustomerManagerName" />
        <QupListItem label="提报月份" :value="signingRealEstateDTO.submissionDate" />
        <QupListItem label="数据来源" :value="[1,'1'].includes(signingRealEstateDTO.dataSource)?'手工新增':'BPM'" />
        <QupListItem label="启用状态" :value="[1,'1'].includes(signingRealEstateDTO.enable)?'启用':'停用'" />
        <QupListItem label="创建人" :value="signingRealEstateDTO.createByOne" />
        <QupListItem label="创建时间" :value="signingRealEstateDTO.createTimeOne" />
        <QupListItem label="提报人" :value="signingRealEstateDTO.submitterName" />
      </QupList>
    </c-title>
    <c-title title="小区样板间信息">
      <QupList v-loading="loading" :column="3" sep="：" default-value="" label-position="right" label-width="130">
        <QupListItem label="样板间楼栋号" :value="modelRoomInfoDTO.storiedBuildingNumber" />
        <QupListItem label="样板间建设进度" :value="modelRoomInfoDTO.modelRoomBuildSchedule" dict-type-code="YBJ_CONSTRUCTION_STEP" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
        <QupListItem label="样板间运营状态" :value="modelRoomInfoDTO.modelRoomOperateState" dict-type-code="YBJ_OPERATION_STATUS" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
        <QupListItem label="样板间类型" :value="modelRoomInfoDTO.modelRoomType" dict-type-code="YBJ_TYPE" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
        <QupListItem label="产品品类" :value="modelRoomInfoDTO.productType" dict-type-code="YBJ_PRO_CATEGARY" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
        <QupListItem label="样板间建设BPM单号" :value="modelRoomInfoDTO.bpmNumber" />
        <QupListItem label="样板间总面积" :value="`${modelRoomInfoDTO.modelRoomTotalArea || 0}㎡`" />
        <QupListItem label="样板间申请类型" :value="modelRoomInfoDTO.modelRoomApplyType" dict-type-code="YBJ_APPLY_TYPE" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
        <QupListItem label="饰品预计提货时间" :value="modelRoomInfoDTO.decorationPredictDeliveryTime" />
        <QupListItem label="饰品配置方案" :value="modelRoomInfoDTO.decorationAllocationPlan" />
        <QupListItem label="店面设计负责人" :value="modelRoomInfoDTO.headOfStoreDesignName" />
        <QupListItem label="店面设计负责人电话" :value="modelRoomInfoDTO.headOfStoreDesignPhone" />
        <QupListItem label="饰品开单账号" :value="modelRoomInfoDTO.decorationOrderAccount" />
        <QupListItem label="账号名称" :value="modelRoomInfoDTO.decorationOrderAccountName" />
        <QupListItem label="送达方编码" :value="modelRoomInfoDTO.servingPartyCode" />
        <QupListItem label="送达方名称" :value="modelRoomInfoDTO.servingPartyName" />
        <QupListItem label="业主姓名" :value="modelRoomInfoDTO.ownerName" />
        <QupListItem label="业主联系电话" :value="modelRoomInfoDTO.ownerPhone" />
        <QupListItem label="特殊情况说明" :value="modelRoomInfoDTO.specialSituationExplain" :span="24" />
        <QupListItem label="申请人AD账号" :value="modelRoomInfoDTO.applicantCode" />
        <QupListItem label="申请人姓名" :value="modelRoomInfoDTO.applicantName" />
        <QupListItem label="申请时间" :value="modelRoomInfoDTO.applicantTime" />
        <QupListItem label="申请人类型" :value="modelRoomInfoDTO.applicantType" dict-type-code="PROPOSER_TYPE" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
        <QupListItem label="设计资料附件" :span="24">
          <PrototypeRoomFile :files="modelRoomInfoDTO.designDataAnnex" />
        </QupListItem>
        <QupListItem label="调整后设计方案附件" :span="24">
          <PrototypeRoomFile :files="modelRoomInfoDTO.modifyAfterDesignDataAnnex" />
        </QupListItem>
        <QupListItem label="饰品配置方案附件" :span="24">
          <PrototypeRoomFile :files="modelRoomInfoDTO.decorationAllocationPlanAccessory" />
        </QupListItem>
      </QupList>
    </c-title>
    <c-title title="小区样板间订单信息">
      <table-box show-index :data="orderTableData" :table-config="orderTableConfig" />
    </c-title>
    <c-title title="小区样板间验收信息">
      <QupList v-loading="loading" :column="3" sep="：" default-value="" label-position="right" label-width="160">
        <QupListItem label="样板间是否开始运营" :value="modelRoomAcceptanceDTO.isOperation" dict-type-code="BOOLEANS" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
        <QupListItem label="样板间实际运营时间（起）" :value="modelRoomAcceptanceDTO.realOperationStartTime" />
        <QupListItem label="样板间实际运营时间（止）" :value="modelRoomAcceptanceDTO.realOperationEndTime" />
        <QupListItem label="验收申请说明" :value="modelRoomAcceptanceDTO.acceptanceApplyForInstruction" :span="24" />
        <QupListItem label="验收流程单号" :value="modelRoomAcceptanceDTO.acceptanceProcessNumber" />
        <QupListItem label="验收提报人" :value="modelRoomAcceptanceDTO.acceptanceProcessName" />
        <QupListItem label="验收提报时间" :value="modelRoomAcceptanceDTO.acceptanceSubmissionTime" />
        <QupListItem label="是否完成验收" :value="modelRoomAcceptanceDTO.isCompletionAcceptance" dict-type-code="BOOLEANS" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
        <QupListItem label="形象督导" :value="modelRoomInfoDTO.supervisionImage" />
        <QupListItem label="饰品是否已开单" :value="modelRoomInfoDTO.isAccessoriesOrder" dict-type-code="BOOLEANS" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
        <QupListItem label="饰品是否有减免" :value="modelRoomInfoDTO.isAccessoriesDerate" dict-type-code="BOOLEANS" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
        <QupListItem label="样板间户型" :value="modelRoomInfoDTO.modelApartmentType" />
        <QupListItem label="软装陈列是否合格" :value="modelRoomInfoDTO.isSoftDecoraDisQualified" dict-type-code="BOOLEANS" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
        <QupListItem label="软装陈列评分" :value="modelRoomInfoDTO.softDecoraDisScore" />
        <QupListItem label="实际验收时间" :value="modelRoomAcceptanceDTO.actualAcceptanceTime" />
        <QupListItem label="首次验收结果" :value="modelRoomAcceptanceDTO.firstAcceptanceResult" dict-type-code="YBJ_FIST_CHECK_RESULE" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
        <QupListItem label="整改结果" :value="modelRoomAcceptanceDTO.rectificationResult" dict-type-code="YBJ_RECTIFY_RESULE" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
        <QupListItem label="最终验收结果" :value="modelRoomAcceptanceDTO.finalAcceptanceResult" dict-type-code="YBJ_FINAL_CHECK_RESULE" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
        <QupListItem label="验收申请人AD账号" :value="modelRoomAcceptanceDTO.acceptanceApplicantCode" />
        <QupListItem label="验收申请人姓名" :value="modelRoomAcceptanceDTO.acceptanceApplicantName" />
        <QupListItem label="验收申请时间" :value="modelRoomAcceptanceDTO.acceptanceApplicantTime" />
        <QupListItem label="设计师软装审核通过时间" :value="modelRoomAcceptanceDTO.designerReviewTime" />

        <QupListItem label="软装陈列附件" :span="24">
          <PrototypeRoomFile :files="modelRoomAcceptanceDTO.softOutfitDisplayFile" />
        </QupListItem>
        <QupListItem label="验收报告" :span="24">
          <PrototypeRoomFile :files="modelRoomAcceptanceDTO.acceptanceReportFile" />
        </QupListItem>
        <QupListItem label="整改报告" :span="24">
          <PrototypeRoomFile :files="modelRoomAcceptanceDTO.rectificationReportFile" />
        </QupListItem>
      </QupList>
    </c-title>
    <c-title title="小区样板间返利信息">
      <QupList v-loading="loading" :column="3" sep="：" default-value="" label-position="right" label-width="130">
        <QupListItem label="是否申请返利" :value="modelRoomRebateDTO.isApplyRebate" dict-type-code="BOOLEANS" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
        <QupListItem label="返利提报时间" :value="modelRoomRebateDTO.rebateSubmissionTime" />
        <QupListItem label="返利审核结果" :value="modelRoomRebateDTO.rebateAuditResult" dict-type-code="REVIEW_RESULT" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
        <QupListItem label="返利申请人AD账号" :value="modelRoomRebateDTO.rebateApplicantCode" />
        <QupListItem label="返利申请时间" :value="modelRoomRebateDTO.rebateApplyTime" />
        <QupListItem label="返利申请单号" :value="modelRoomRebateDTO.rebateApplyNumber" />
        <QupListItem label="返利申请人姓名" :value="modelRoomRebateDTO.rebateApplicantName" />
        <QupListItem label="返利申报类型" :value="modelRoomRebateDTO.rebateType" dict-type-code="REBATE_TYPE" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
        <QupListItem label="返利申报批次" :value="modelRoomRebateDTO.rebateDeclarationBatch" />
        <QupListItem label="返利申报说明" :value="modelRoomRebateDTO.rebateApplyMsg" :span="24" />
        <QupListItem label="是否执行返利" :value="modelRoomRebateDTO.isExecuteRebate" dict-type-code="BOOLEANS" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
        <QupListItem label="返利执行时间" :value="modelRoomRebateDTO.rebateExecuteTime" />
        <QupListItem label="不申请返利原因" :value="modelRoomRebateDTO.notApplyRebateMsg" :span="24" />
        <QupListItem label="不执行返利原因" :value="modelRoomRebateDTO.notExecuteRebateMsg" :span="24" />
        <QupListItem label="返利执行说明" :value="modelRoomRebateDTO.executeRebateMsg" :span="24" />
      </QupList>
    </c-title>
    <div class="btn-center">
      <c-button type="primary" @click="handleGoBack">返回</c-button>
    </div>
  </el-dialog>
</template>
<script>
import { prototypeRoomDetail } from '@/api/channelTask2/dealerCustomer'
import PrototypeRoomFile from './prototypeRoomFile'
export default {
  name: 'PrototypeRoomDetail',
  components: {
    PrototypeRoomFile
  },
  data() {
    return {
      loading: false,
      visible: false,
      detail: {},
      id: '',
      orderTableConfig: {
        hideFuncBar: true,
        tabIndex: 20,
        setting: [
          {
            prop: 'orderType',
            label: '订单类型',
            minWidth: 100,
            propEnum: {
              appCode: 'slm',
              domainCode: 'marketing',
              dictTypeCode: 'YBJ_ORDER_TYPE'
            }
          },
          {
            prop: 'orderNumber',
            label: '接单编号',
            minWidth: 100
          },
          {
            prop: 'salesSeries',
            label: '销售系列',
            minWidth: 100
          }
        ]
      }
    }
  },
  computed: {
    modelRoomInfoDTO() {
      return this.detail.modelRoomInfoDTO || {}
    },
    signingRealEstateDTO() {
      return this.detail.signingRealEstateDTO || {}
    },
    orderTableData() {
      return this.detail.modelRoomOrderDTO || []
    },
    modelRoomAcceptanceDTO() {
      return this.detail.modelRoomAcceptanceDTO || {}
    },
    modelRoomRebateDTO() {
      return this.detail.modelRoomRebateDTO || {}
    }
  },
  methods: {
    openDialog(id) {
      this.id = id
      this.visible = true
    },
    handleOpen() {
      this.loading = true
      prototypeRoomDetail(this.id).then(res => {
        this.detail = res.data
      }).finally(() => {
        this.loading = false
      })
    },
    handleClosed() {
      this.detail = {}
      this.id = ''
    },
    handleGoBack() {
      this.visible = false
    }
  }
}
</script>
